//
//  CHApplicationAdditions.m
//  Chocolat
//
//  Created by Pieter Omvlee on 12/18/08.
//  Copyright 2008 Bohemian Coding. All rights reserved.
//

#import "CHApplicationAdditions.h"


@implementation NSApplication (CHApplicationAdditions)

- (IBAction)relaunch:(id)sender
{
	char pidstr[10]; 
	sprintf(pidstr,"%d",getpid());
	setenv("relaunchFromPid",pidstr,YES);
	[NSTask launchedTaskWithLaunchPath:[[NSBundle mainBundle] executablePath] arguments:[NSArray array]];
	
	[NSApp terminate:self];
}

@end
